import {JIA,JIAN} from './constant'
export default function countReducer(pre,action){
  if(pre === undefined){
    pre = 0
  }
  const {type,data} = action
  switch (type) {
    case JIA:
      return pre + data
    case JIAN:
      return pre - data
    // case JIAN:
    //   return pre + data
    // case"yiJia":
    //   return pre + data
    default:
     return pre
  }
}